package com.aop.concert;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

/**
 * 表演结束发表言论
 */
@Aspect
public class CriticAspect {

    private CriticisEngine criticisimEngine;

    @Pointcut("execution(* com.aop.concert.Performance.perform(..))")
    public void pc() {
    }

    @After("pc()")
    public void afterRunning() {
        System.out.println(criticisimEngine.getCriticis());
    }

    /**
     * 注入criticisEngine
     * @param criticisimEngine
     */
    public void setCriticisimEngine(CriticisEngine criticisimEngine) {
        this.criticisimEngine = criticisimEngine;
    }
}
